/*
 * Copyright 2011 The Rusted Roof, LLC.
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package org.proteusframework.core.api.ext;

/**
 * @author Tacoma Four
 */
public interface IAdapterFactory
{

    /**
     * Adapts this object to a different type of object represented by the parameters. This is a very common Eclipse
     * design pattern that has proven its mettle and has been included in the framework for future expansion.
     *
     * @param adaptableObject Object to adapt to
     * @param adapterType     Expected interface to adapt to
     * @return Adapted object, or null if the adaption couldn't be made
     */
    Object getAdapter(Object adaptableObject, Class adapterType);

    /**
     * List of registered adapters that this object supports.
     *
     * @return Non-null list of supported adapters
     */
    Class[] getAdapterList();

}
